package org.hanyx.server;

import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * SayController class
 *
 * @author hanyx
 * @date 2016/10/31
 */
@RestController
public class SayController {

    @GetMapping("say1")
    public String say1(@RequestParam String name) {
        return "hello " + name;
    }

    @GetMapping("rets")
    public String rets(HttpServletRequest request) {
        System.out.println(request);
        return "hello world" ;
    }

    @GetMapping("/")
    public String index(HttpServletRequest request) {
        return "hello world" ;
    }

    @GetMapping("/say2/{name}")
    public String say2(@PathVariable String name) {
        return "hello1 " + name;
    }

    @GetMapping("say3")
    public String say3(@RequestHeader String name){
        return "hello " + name;
    }
}
